// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file Header.cpp
 * This source file contains the implementation of the described types in the IDL file.
 *
 * This file was generated by the tool fastddsgen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace {
char dummy;
}  // namespace
#endif  // _WIN32

#include "Header.h"

#include <fastcdr/Cdr.h>


#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>




Header::Header()
{
}

Header::~Header()
{
}

Header::Header(
        const Header& x)
{
    m_id = x.m_id;
    m_name = x.m_name;
    m_buildTime = x.m_buildTime;
}

Header::Header(
        Header&& x) noexcept
{
    m_id = x.m_id;
    m_name = std::move(x.m_name);
    m_buildTime = std::move(x.m_buildTime);
}

Header& Header::operator =(
        const Header& x)
{

    m_id = x.m_id;
    m_name = x.m_name;
    m_buildTime = x.m_buildTime;
    return *this;
}

Header& Header::operator =(
        Header&& x) noexcept
{

    m_id = x.m_id;
    m_name = std::move(x.m_name);
    m_buildTime = std::move(x.m_buildTime);
    return *this;
}

bool Header::operator ==(
        const Header& x) const
{
    return (m_id == x.m_id &&
           m_name == x.m_name &&
           m_buildTime == x.m_buildTime);
}

bool Header::operator !=(
        const Header& x) const
{
    return !(*this == x);
}

/*!
 * @brief This function sets a value in member id
 * @param _id New value for member id
 */
void Header::id(
        uint32_t _id)
{
    m_id = _id;
}

/*!
 * @brief This function returns the value of member id
 * @return Value of member id
 */
uint32_t Header::id() const
{
    return m_id;
}

/*!
 * @brief This function returns a reference to member id
 * @return Reference to member id
 */
uint32_t& Header::id()
{
    return m_id;
}


/*!
 * @brief This function copies the value in member name
 * @param _name New value to be copied in member name
 */
void Header::name(
        const std::string& _name)
{
    m_name = _name;
}

/*!
 * @brief This function moves the value in member name
 * @param _name New value to be moved in member name
 */
void Header::name(
        std::string&& _name)
{
    m_name = std::move(_name);
}

/*!
 * @brief This function returns a constant reference to member name
 * @return Constant reference to member name
 */
const std::string& Header::name() const
{
    return m_name;
}

/*!
 * @brief This function returns a reference to member name
 * @return Reference to member name
 */
std::string& Header::name()
{
    return m_name;
}


/*!
 * @brief This function copies the value in member buildTime
 * @param _buildTime New value to be copied in member buildTime
 */
void Header::buildTime(
        const Time& _buildTime)
{
    m_buildTime = _buildTime;
}

/*!
 * @brief This function moves the value in member buildTime
 * @param _buildTime New value to be moved in member buildTime
 */
void Header::buildTime(
        Time&& _buildTime)
{
    m_buildTime = std::move(_buildTime);
}

/*!
 * @brief This function returns a constant reference to member buildTime
 * @return Constant reference to member buildTime
 */
const Time& Header::buildTime() const
{
    return m_buildTime;
}

/*!
 * @brief This function returns a reference to member buildTime
 * @return Reference to member buildTime
 */
Time& Header::buildTime()
{
    return m_buildTime;
}


// Include auxiliary functions like for serializing/deserializing.
#include "HeaderCdrAux.ipp"

